﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace agile_tool.userControl
{
    /// <summary>
    /// Interaction logic for timeAssignmentItem.xaml
    /// </summary>
    public partial class timeAssignmentItem : UserControl
    {

        public int taskHourId;
        public int taskId;
       
        public timeAssignmentItem()
        {
            InitializeComponent();
        }

        private void tbRemainng_TextChanged(object sender, TextChangedEventArgs e)
        {

            try
            {
                int.Parse(((TextBox)sender).Text);
            }
            catch { ((TextBox)sender).Text = "0"; }
        }

        public bool checkOthers()
        {
            timeAssignmentPage _timeAssignmentPage = new timeAssignmentPage();
            _timeAssignmentPage = (timeAssignmentPage)helper.FindParrentUserControl(((DependencyObject)this), _timeAssignmentPage.GetType().ToString());
            return _timeAssignmentPage.checkTheTimes();
        }

        private void btnSave_Click(object sender, RoutedEventArgs e)
        {

        }

        public void fixTheTimes()
        {
            timeAssignmentPage _timeAssignmentPage = new timeAssignmentPage();
            _timeAssignmentPage = (timeAssignmentPage)helper.FindParrentUserControl(((DependencyObject)this), _timeAssignmentPage.GetType().ToString());
            _timeAssignmentPage.fixTheTimes();
        }
    }
}
